package com.jiazhong.basic.pack0517;

import com.jiazhong.basic.pack0517.db.DBManager;
import lombok.SneakyThrows;

import java.sql.Connection;
import java.sql.PreparedStatement;

public class DemoG {
    @SneakyThrows
    public static void main(String[] args) {
        Connection conn = DBManager.getConnection();
        String sql = "update emp set state=0 where empno=? and state=1";
        PreparedStatement ps = conn.prepareStatement(sql);
        ps.setInt(1,7960);
        ps.executeUpdate();
        ps.close();
        conn.close();
    }
}
